package com.anolesoft.yr.mbus.prod.base.sql;

public class ProdBaseServiceValueSQL {

    //新增服务项参数基础信息表
    public static final String SAVE_PROD_BASE_SERVICE_VALUE = "insert into prod_base_service_value(objuid,fac_code,prod_base_service_uid,value,is_default,is_holiday,accept_time,reply_time,delivery_time,arrival_time,remark,c_user_uid,c_time,del_flag) values(#{objuid},#{facCode},#{prodBaseServiceUid},#{value},#{isDefault},#{isHoliday},#{acceptTime},#{replyTime},#{deliveryTime},#{arrivalTime},#{remark},#{ccUserUid},#{ccTime},#{delFlag})";

    //根据主键查询服务项参数基础唯一数据
    public static final String QUERY_PROD_BASE_SERVICE_VALUE_BY_UID = "select a.objuid,a.value,case when a.is_default=0 then '否' else '是' end is_default,case when a.is_holiday=0 then '否' else '是' end is_holiday,a.accept_time,a.reply_time,a.delivery_time,a.arrival_time,a.remark from prod_base_service_value a where a.del_flag=0 and a.prod_base_service_uid=#{uid}";

    //根据主键查询服务项参数基础唯一数据
    public static final String QUERY_PROD_BASE_SERVICE_VALUE_BY_UID2 = "select a.* from prod_base_service_value a where a.del_flag=0 and a.prod_base_service_uid=#{uid} order by a.value asc";

    //修改服务项参数基础信息表
    public static final String UPDATE_PROD_BASE_SERVICE_VALUE = "update prod_base_service_value a set a.fac_code=#{facCode},a.prod_base_service_uid=#{prodBaseServiceUid},a.value=#{value},a.is_default=#{isDefault},a.is_holiday=#{isHoliday},a.accept_time=#{acceptTime},a.reply_time=#{replyTime},a.delivery_time=#{deliveryTime},a.arrival_time=#{arrivalTime},a.remark=#{remark},a.m_user_uid=#{mmUserUid},a.m_time=#{mmTime} where a.objuid=#{objuid}";

    //删除服务项参数基础信息表
    public static final String DELETE_PROD_BASE_SERVICE_VALUE = "update prod_base_service_value a set a.del_flag=1 where a.prod_base_service_uid=#{objuid}";

    //修改时删除服务项参数基础信息表
    public static final String DELETE_PROD_BASE_SERVICE_VALUE2 = "<script> update prod_base_service_value a set a.del_flag=1 where a.prod_base_service_uid=#{prodBaseServiceUid} and a.objuid not in <foreach collection='prodBaseServiceValueDeleteDTOList' open='(' item='prodBaseServiceValue' separator=',' close=')'> #{prodBaseServiceValue.objuid}</foreach> </script>";

}